#define _CRT_SECURE_NO_WARNINGS 1
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
typedef int Heapdatatype;
typedef struct Heap
{
	Heapdatatype* a;
	int size;
	int capacity;
}Hp;

void Adjustdown(Heapdatatype* a, int n, int parent);

void HeapPush(Hp* php, Heapdatatype x);
void HeapInit(Hp* php);
void HeapDestroy(Hp* php);
void HeapPrint(Hp* php);
void HeapPop(Hp* php);
Heapdatatype HeapTop(Hp* php);
void HeapCreate(Hp* php, Heapdatatype* a, int n);
void SortHeap(int* a,int n);
